package com.tutou.ikgroup;

import com.tutou.ikgroup.websocket.netty.NettyWebsocket;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.scheduling.annotation.EnableAsync;

@EnableAsync
//@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
@MapperScan(basePackages = {"com.tutou.ikuser.mapper", "com.tutou.ikgroup.mapper"})
public class IkGroupApplication implements CommandLineRunner {

    @Autowired
    private NettyWebsocket nettyWebsocket;

    public static void main(String[] args) {
        SpringApplication.run(IkGroupApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        nettyWebsocket.startNetty();
    }
}
